<?php



if (!defined('EXPONENT')) exit('');

$contact = null;
if (isset($_GET['id'])) {
	$contact = $db->selectObject('addressbook_contact','id='.intval($_GET['id']));
}

if ($contact) {
  if ($contact->image > 0){
			   $temp=$db->selectObject('file',"id = {$contact->image}");
			   if ($temp)
			     $contact->image_path=$temp->directory."/".$temp->filename;
			  else 
			     $contact->image_path='';
      }	
	$loc = unserialize($contact->location_data);
	$template = new template('addressbookmodule','_view',$loc);
	$template->assign('contact',$contact);
	$template->register_permissions(
		array('edit','delete'),
		exponent_core_makeLocation($loc->mod,$loc->src,$contact->id)
	);
	
	$template->output();
} else {
	echo SITE_404_HTML;
}

?>